<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('轮值倒班信息列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
              <form id="formId" >
                    <div class="select-list">
                        <ul>
                            <li >
                                <p style="width: 120px">轮值规则：</p>
                  <select id="dutyId" name="dutyId" th:with="duty=${@dutyService.selectDutyList(null)}" style="width:100px">
                      <option th:each="duty : ${duty}" th:text="${duty.name}" th:value="${duty.id}" ></option>
                  </select>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()"  >
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" >
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"  >
                    <i class="fa fa-remove"></i> 删除
                </a>
               
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table  id="bootstrap-table">
                </table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var datas = [[${@dutyTeam.selectDutyTeamList(null)}]];
        var prefix = ctx + "duty/turns";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "轮值倒班信息",
                columns: [{
                	title : '值班表',
                    checkbox: true
                },
                {
                    field : 'orderid', 
                    title : '显示顺序'
                },
                {
                    field : 'id', 
                  
                    visible: false
                },
                {
                    field : 'map.data1', 
                    title : '后夜班',
                    formatter: function(value, row, index) {
		            	return $.table.selectDataLabel(datas, value);
		            }
                },
                 
                {
                    field : 'map.data2', 
                    title : '白班',
                    formatter: function(value, row, index) {
		            	return $.table.selectDataLabel(datas, value);
		            }
                },
                {
                    field : 'map.data3', 
                    title : '中班',
                    formatter: function(value, row, index) {
		            	return $.table.selectDataLabel(datas, value);
		            }
                },{
                    field : 'map.data4', 
                    title : '前夜班',
                    formatter: function(value, row, index) {
		            	return $.table.selectDataLabel(datas, value);
		            }
                }
                ]
            };
             $.table.init(options);
        });
    </script>
</body>
</html>